﻿<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <title>叩丁狼CRM(演示版)</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <#include "../common/head.ftl"/>
    <script src="/js/plugins/My97DatePicker/WdatePicker.js"></script>
    <link rel="stylesheet" href="/css/core.css"/>
</head>
<body>
<#assign menu="customerPool"/>
<div class="container " style="margin-top: 20px">
    <#include "../common/welcome.ftl"/>
    <div class="row">

        <#include "../common/menu.ftl"/>


        <div class="col-sm-9">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line">客户资源池管理</h1>
                </div>
            </div>

            <form class="form-inline" id="searchForm" action="/customerPool/list.do" method="post">
                <input type="hidden" name="currentPage" id="currentPage" value="1">
                <div class="form-group">
                    <label for="keyword">关键字:</label>
                    <input type="text" class="form-control" name="keyword"  placeholder="请输入姓名/手机号">
                </div>

                <button id="btn_query" class="btn btn-default">
                    <span class="glyphicon glyphicon-search"></span> 查询
                </button>
            </form>

            <table class="table table-striped table-hover" >
                <tr>
                    <th>编号</th>
                    <th>姓名</th>
                    <th>年龄</th>
                    <th>性别</th>
                    <th>电话</th>
                    <th>QQ</th>
                    <th>职业</th>
                    <th>来源</th>
                    <th>营销人员</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                <#list pageInfo.list as entity >
                <tr>
                    <td>${entity_index + 1}</td>
                    <td>${entity.name}</td>
                    <td>${entity.age}</td>
                    <td>${entity.genderName}</td>
                    <td>${entity.tel}</td>
                    <td>${entity.qq}</td>
                    <td>${entity.job.title}</td>
                    <td>${entity.source.title}</td>
                    <td>${entity.seller.name}</td>
                    <td>${entity.statusName}</td>
                     <td>
                         <a role="button" data-json='${entity.json}' class="btn btn-warning btn-xs transferMeBtn">
                             <span  class="glyphicon glyphicon-leaf"></span> 移交给我
                         </a>
                         <@shiro.hasAnyRoles name="admin,客户经理">
                         <a role="button" data-json='${entity.json}' class="btn btn-warning btn-xs transferAnyBtn">
                             <span  class="glyphicon glyphicon-leaf"></span> 移交
                         </a>
                         </@shiro.hasAnyRoles>
                     </td>
                </tr>
                </#list>
            </table>
            <#include "../common/page.ftl"/>
        </div>
    </div>
</div>
<script>

    $(function () {
        //移交给我
        $(".transferMeBtn").click(function () {
            $("#transferForm").val("");
            backPlay(this);
            $("#transferForm select[name='newSeller.id']").prop("disabled",true);
        });


        //高级查询
        $(".btn_query").click(function () {
            $("#searchForm").submit();
        });

        //回显
        <#if qo??>
            <#if qo.keyword??>
                $("input[name='keyword']").val("${qo.keyword}");//要加双引号
            </#if>
        </#if>


    });

</script>
<#include "../common/transfer.ftl"/>
<#include "../common/mycode.ftl"/>
</body>
</html>